const jwt = require('jsonwebtoken')

module.exports = {
	getUserByCtx(ctx){
		const token = ctx.header.authorization.split(' ')[1]
		var user = jwt.decode(token)
		user.token = token
		return user
	}
}